local XMPQT = XLGetGlobal("XMPQT")
local result = false

function RunXmp(command)
	local path  = XMPQT.API:Call("GetXmpReg","Path")
	XMPQT.Output.Info("xmp路径："..path)
	local timeA=nil
	local timeB=nil
	if path ~= nil then
		timeA=os.clock()
		XMPQT.API:Call("SHExec",path,command)
		timeB=os.clock()-timeA;--有缺陷，命令执行完不等于窗口已呈现
		XMPQT.API:Call("Sleep",1000)
		
		result = XMPQT.API:Call("IsXmpRunning")
		XMPQT.Continue(result)
	else
		XMPQT.Continue(false,"XMP未安装")
	end
	XMPQT.Output.Info(string.format("XMP启动用时: %.5f\n秒", timeB))
	--打日志
	--XMPQT.LOG(string.format("%.5f\n",timeB))
	return timeB
	
end

--XLModuleExists(path)
--XLLoadModule(path)
--XLUnloadModule(path)
--SetOnceTimer
--AsyncCall
--local f = assert(io.open("_.txt", "w"))
--f:write("This is a test string!\n")
--f:close()
local str = ""

--for k,v in pairs(_G) do
--XMPQT.Output.Info(tostring(k))
--end
--XLMessageBox(str)
RunXmp("")
